home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / include / RCS / windowstr.h,v < prev   
Encoding:
Text File  |  1990-02-15  |  6.4 KB  |  201 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     90.02.14.16.17.57;  author tve;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Original X11R4 distribution
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/* $XConsortium: windowstr.h,v 5.13 89/10/04 10:27:15 rws Exp $ */
  27. /***********************************************************
  28. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  29. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  30.  
  31.                         All Rights Reserved
  32.  
  33. Permission to use, copy, modify, and distribute this software and its 
  34. documentation for any purpose and without fee is hereby granted, 
  35. provided that the above copyright notice appear in all copies and that
  36. both that copyright notice and this permission notice appear in 
  37. supporting documentation, and that the names of Digital or MIT not be
  38. used in advertising or publicity pertaining to distribution of the
  39. software without specific, written prior permission.  
  40.  
  41. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  42. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  43. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  44. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  45. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  46. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  47. SOFTWARE.
  48.  
  49. ******************************************************************/
  50.  
  51. #ifndef WINDOWSTRUCT_H
  52. #define WINDOWSTRUCT_H
  53.  
  54. #include "window.h"
  55. #include "pixmapstr.h"
  56. #include "regionstr.h"
  57. #include "cursor.h"
  58. #include "property.h"
  59. #include "resource.h"    /* for ROOT_WINDOW_ID_BASE */
  60. #include "dix.h"
  61. #include "miscstruct.h"
  62. #include "Xprotostr.h"
  63.  
  64. #define GuaranteeNothing    0
  65. #define GuaranteeVisBack    1
  66.  
  67. #define SameBackground(as, a, bs, b)                \
  68.     ((as) == (bs) && ((as) == None ||                \
  69.               (as) == ParentRelative ||            \
  70.                SamePixUnion(a,b,as == BackgroundPixel)))
  71.  
  72. #define SameBorder(as, a, bs, b)                \
  73.     EqualPixUnion(as, a, bs, b)
  74.  
  75. typedef struct _WindowOpt {
  76.     VisualID        visual;           /* default: same as parent */
  77.     CursorPtr        cursor;           /* default: window.cursorNone */
  78.     Colormap        colormap;       /* default: same as parent */
  79.     Mask        dontPropagateMask; /* default: window.dontPropagate */
  80.     Mask        otherEventMasks;   /* default: 0 */
  81.     struct _OtherClients *otherClients;       /* default: NULL */
  82.     struct _GrabRec    *passiveGrabs;       /* default: NULL */
  83.     PropertyPtr        userProps;       /* default: NULL */
  84.     unsigned long    backingBitPlanes;  /* default: ~0L */
  85.     unsigned long    backingPixel;       /* default: 0 */
  86. #ifdef SHAPE
  87.     RegionPtr        boundingShape;       /* default: NULL */
  88.     RegionPtr        clipShape;       /* default: NULL */
  89. #endif
  90. #ifdef XINPUT
  91.     struct _OtherInputMasks *inputMasks;   /* default: NULL */
  92. #endif
  93. } WindowOptRec, *WindowOptPtr;
  94.  
  95. #define BackgroundPixel        2L
  96. #define BackgroundPixmap    3L
  97.  
  98. typedef struct _Window {
  99.     DrawableRec        drawable;
  100.     WindowPtr        parent;        /* ancestor chain */
  101.     WindowPtr        nextSib;    /* next lower sibling */
  102.     WindowPtr        prevSib;    /* next higher sibling */
  103.     WindowPtr        firstChild;    /* top-most child */
  104.     WindowPtr        lastChild;    /* bottom-most child */
  105.     RegionRec        clipList;    /* clipping rectangle for output */
  106.     RegionRec        borderClip;    /* NotClippedByChildren + border */
  107.     union _Validate    *valdata;
  108.     RegionRec        winSize;
  109.     RegionRec        borderSize;
  110.     DDXPointRec        origin;        /* position relative to parent */
  111.     unsigned short    borderWidth;
  112.     unsigned short    deliverableEvents;
  113.     Mask        eventMask;
  114.     PixUnion        background;
  115.     PixUnion        border;
  116.     pointer        backStorage;    /* null when BS disabled */
  117.     WindowOptPtr    optional;
  118.     unsigned        backgroundState:2; /* None, Relative, Pixel, Pixmap */
  119.     unsigned        borderIsPixel:1;
  120.     unsigned        cursorIsNone:1;    /* else same as parent */
  121.     unsigned        backingStore:2;
  122.     unsigned        saveUnder:1;
  123.     unsigned        DIXsaveUnder:1;
  124.     unsigned        bitGravity:4;
  125.     unsigned        winGravity:4;
  126.     unsigned        overrideRedirect:1;
  127.     unsigned        visibility:2;
  128.     unsigned        mapped:1;
  129.     unsigned        realized:1;    /* ancestors are all mapped */
  130.     unsigned        viewable:1;    /* realized && InputOutput */
  131.     unsigned        dontPropagate:3;/* index into DontPropagateMasks */
  132.     DevUnion        *devPrivates;
  133. } WindowRec;
  134.  
  135. /*
  136.  * Ok, a bunch of macros for accessing the optional record
  137.  * fields (or filling the appropriate default value)
  138.  */
  139.  
  140. extern WindowPtr    FindWindowWithOptional();
  141. extern Mask        DontPropagateMasks[];
  142.  
  143. #define wTrackParent(w,field)    ((w)->optional ? \
  144.                     w->optional->field \
  145.                   : FindWindowWithOptional(w)->optional->field)
  146. #define wUseDefault(w,field,def)    ((w)->optional ? \
  147.                     w->optional->field \
  148.                  : def)
  149.  
  150. #define wVisual(w)        wTrackParent(w, visual)
  151. #define wCursor(w)        ((w)->cursorIsNone ? None : wTrackParent(w, cursor))
  152. #define wColormap(w)        ((w)->drawable.class == InputOnly ? None : wTrackParent(w, colormap))
  153. #define wDontPropagateMask(w)    wUseDefault(w, dontPropagateMask, DontPropagateMasks[(w)->dontPropagate])
  154. #define wOtherEventMasks(w)    wUseDefault(w, otherEventMasks, 0)
  155. #define wOtherClients(w)    wUseDefault(w, otherClients, NULL)
  156. #ifdef XINPUT
  157. #define wOtherInputMasks(w)    wUseDefault(w, inputMasks, NULL)
  158. #else
  159. #define wOtherInputMasks(w)    NULL
  160. #endif
  161. #define wPassiveGrabs(w)    wUseDefault(w, passiveGrabs, NULL)
  162. #define wUserProps(w)        wUseDefault(w, userProps, NULL)
  163. #define wBackingBitPlanes(w)    wUseDefault(w, backingBitPlanes, ~0L)
  164. #define wBackingPixel(w)    wUseDefault(w, backingPixel, 0)
  165. #ifdef SHAPE
  166. #define wBoundingShape(w)    wUseDefault(w, boundingShape, NULL)
  167. #define wClipShape(w)        wUseDefault(w, clipShape, NULL)
  168. #endif
  169. #define wClient(w)        (clients[CLIENT_ID((w)->drawable.id)])
  170. #define wBorderWidth(w)        ((int) (w)->borderWidth)
  171.  
  172. /* true when w needs a border drawn. */
  173.  
  174. #ifdef SHAPE
  175. #define HasBorder(w)    ((w)->borderWidth || wClipShape(w))
  176. #else
  177. #define HasBorder(w)    ((w)->borderWidth)
  178. #endif
  179.  
  180. extern int DeleteWindow();
  181. extern int ChangeWindowAttributes();
  182. extern int WalkTree();
  183. extern Bool CreateRootWindow();
  184. extern WindowPtr CreateWindow();
  185. extern int DeleteWindow();
  186. extern int DestroySubwindows();
  187. extern int ChangeWindowAttributes();
  188. extern int GetWindowAttributes();
  189. extern int ConfigureWindow();
  190. extern int ReparentWindow();
  191. extern int MapWindow();
  192. extern int MapSubwindow();
  193. extern int UnmapWindow();
  194. extern int UnmapSubwindow();
  195. extern RegionPtr NotClippedByChildren();
  196. extern void SendVisibilityNotify();
  197.  
  198. #endif /* WINDOWSTRUCT_H */
  199.  
  200. @
  201.